#pragma once

#include <ace/SOCK_Stream.h>
#include <ace/Event_Handler.h>
#include <ace/Reactor.h>
#include <ace/SOCK_Acceptor.h>

class ListenAccept : public ACE_Event_Handler
{
public:
	ListenAccept(ACE_Reactor* act = ACE_Reactor::instance());
    virtual ~ListenAccept();

    virtual ACE_HANDLE get_handle (void) const;
    virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);

    int open(int port);

protected:
	ACE_SOCK_Acceptor m_objAcceptor;
};